<?php
class lib_company_fankui_log extends lib_base{
	public $table_name = "qc_company_fankui_log";
    public $pk = "id";

    public function add_log($order_id,$data=[]){
		$order = D('company_fankui')->get_info($order_id);

		$msg = array(
    		'1'=>'提交了反馈',
    		'2'=>'派送了反馈',
    		'3'=>'接受了反馈',
    		'4'=>'反馈已完成',
    		'5'=>'反馈已确认',
    		'6'=>'评价了反馈',
    		'7'=>'结算了反馈',
    		'99'=>'取消了反馈',
    	);

    	$intro['msg'] = $msg[$order['order_status']];
        if($order['order_status'] > 1){
            // if($data['photo']) $intro['photo'] = joinStr($data['photo']);
			if($data['photo']){
				$intro['photo'] = json_decode($data['photo'],true);
			}
            if($data['intro']) $intro['intro'] = $data['intro'];
		}

    	if($order){
	        $arrBase = array(
				'company_id' =>$order['company_id'],
	        	'fankui_id' =>$order_id,
				'intro' =>serialize($intro),
				'order_status' =>$order['order_status'],
				'status' =>1,
				'add_time'=>date('Y-m-d H:i:s'),
			);
			return $this->add($arrBase);
		}

    }
}